/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主应用容器 */
.todo-app {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* 添加任务区域 */
.add-task-section {
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e0e6ed;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

#taskInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

#taskInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.add-btn:active {
    transform: translateY(0);
}

/* 过滤器区域 */
.filter-section {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e6ed;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.clear-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* 任务列表容器 */
.task-list-container {
    min-height: 300px;
    position: relative;
}

.task-list {
    list-style: none;
    padding: 0;
}

.task-item {
    padding: 20px 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    background: white;
}

.task-item:hover {
    background: #f8f9fa;
}

.task-item.completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.task-checkbox.checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.task-text {
    font-size: 16px;
    line-height: 1.4;
    word-break: break-word;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #888;
}

.task-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 15px;
}

.task-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.action-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.edit-btn {
    background: #17a2b8;
    color: white;
}

.edit-btn:hover {
    background: #138496;
    transform: scale(1.1);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #888;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

/* 统计信息 */
.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #333;
}

.stat-item i {
    color: #667eea;
    font-size: 1.2rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.modal-body {
    padding: 25px 30px;
}

#editTaskInput {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#editTaskInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer {
    padding: 15px 30px 25px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.cancel-btn, .save-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.task-item {
    animation: slideInTask 0.3s ease;
}

@keyframes slideInTask {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .add-task-section {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .add-btn {
        width: 100%;
    }
    
    .filter-section {
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .task-item {
        padding: 15px 20px;
    }
    
    .task-actions {
        opacity: 1;
    }
    
    .stats {
        flex-direction: column;
    }
    
    .stat-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-btn {
        justify-content: center;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 5px;
    }
}